﻿#include "orders.h"


orders::orders(int order_id, int user_id, int train_id, int seat_id, int start_station_id, 
	int end_station_id, const std::string& travel_date, const std::string& order_time, const OrderStatus& status, double price)
	: order_id(order_id), user_id(user_id), train_id(train_id), seat_id(seat_id), 
	start_station_id(start_station_id), end_station_id(end_station_id), travel_date(travel_date), 
	order_time(order_time), status(status), price(price) {
}
// Get方法实现
int orders::getOrderId() const {
	return order_id;
}

int orders::getUserId() const {
	return user_id;
}

int orders::getTrainId() const {
	return train_id;
}

int orders::getSeatId() const {
	return seat_id;
}

int orders::getStartStationId() const {
	return start_station_id;
}

int orders::getEndStationId() const {
	return end_station_id;
}

std::string orders::getTravelDate() const {
	return travel_date;
}

std::string orders::getOrderTime() const {
	return order_time;
}

orders::OrderStatus orders::getStatus() const {
	return status;
}

double orders::getPrice() const {
    return price;
}

// Set方法实现
void orders::setOrderId(int id) {
	order_id = id;
}

void orders::setUserId(int id) {
	user_id = id;
}

void orders::setTrainId(int id) {
	train_id = id;
}

void orders::setSeatId(int id) {
	seat_id = id;
}

void orders::setStartStationId(int id) {
	start_station_id = id;
}

void orders::setEndStationId(int id) {
	end_station_id = id;
}

void orders::setTravelDate(const std::string& date) {
	travel_date = date;
}

void orders::setOrderTime(const std::string& time) {
	order_time = time;
}

void orders::setStatus(const OrderStatus status) {
	this->status = status;
}

void orders::setPrice(double p) {
    price = p;
}
